package model;

import java.util.ArrayList;
import java.util.List;
import java.sql.Date;

/**
 * This class holds the information of a patient invoice.
 * 
 * @author Matthew Edwards 
 * @version 3-5-11
 */

public class PatientInvoice {
    
    private String name, doctor;
    
    private Date date;
   
    private final List<Item> items;

	/**
	 * This constructor creates a new PatientInvoice. It takes in a name, date,
	 * and doctor.
	 * 
	 * @param name
	 *            This is the name of the patient taken in as a String.
	 * @param date
	 *            This is the date of the appointment taken in as a type Date.
	 * @param doctor
	 *            This is the treating doctor taken in as a String.
	 */
    public PatientInvoice(String name, Date date, String doctor){
        this.name = name;
        this.date = date;
        this.doctor = doctor;
        items = new ArrayList<Item>();
    }
    
    /**
     * This getter gets the name and returns it as a string. 
     * 
     * @return Returns the name as a String. 
     */
    public String getName(){
        return name;
    }
    
    /**
     * This setter sets the name by taking in a String. 
     * 
     * @param input Changes the name to the input
     */
    public void setName(String input){
       name = input;
    }
    
    /**
     * This getter gets the date of the invoice and returns it as a type of date. 
     * 
     * @return Date of the invoice
     */
    public Date getDate(){
        return date;
    }
    
    /**
     * This sets the date to the input of a type Date. 
     * 
     * @param input The date to be changed
     */
    public void setDate(Date input){
        date = input;
    }
    
    /**
     * This getter gets the doctor and returns it as a String. 
     * @return The doctor as a string. 
     */
    public String getDoctor(){
        return doctor;
    }
    
    /**
     * This setter sets the doctor by taking in a string. 
     * @param input Takes in the doctor as a String.
     */
    public void setDoctor(String input){
        doctor = input;
    }
      
    /**
     * This getter gets the items that are on the invoice and returns them as a list. 
     * 
     * @return Returns the items as a list. 
     */
    public List<Item> getItems(){
        return items;
    }
    
    /**
     * This method adds an item of type Item to the arraylist. 
     * 
     * @param item The item to be added and will be added at the front.
     */
    public void addItem(Item item){
    	items.add(item);
    }
    
    /**
     * This removes the item at index from the invoice.
     * 
     * @param index The index at which to remove the item from the list.
     */
    public void removeItem(int index){
    	items.remove(index);
    }
    
    /**
     * null
     * 
     * @return null
     */
    public String toString(){
    	return null;
    }
    
}